import request from '@/utils/request'

// 查询入库单列表
export function listRukuInfo(query) {
  return request({
    url: '/business/rukuInfo/list',
    method: 'get',
    params: query
  })
}
// 查询入库任务列表
export function mainListRukuInfo(query) {
  return request({
    url: '/business/rukuInfo/mainList',
    method: 'get',
    params: query
  })
}
// 查询入库单详细
export function getRukuInfo(id) {
  return request({
    url: '/business/rukuInfo/' + id,
    method: 'get'
  })
}

// 新增入库单
export function addRukuInfo(data) {
  return request({
    url: '/business/rukuInfo',
    method: 'post',
    data: data
  })
}
export function addRukuItemInfo(id) {
  return request({
    url: '/business/rukuInfo/addRukuItemInfo/' + id,
    method: 'get'
  })
}
//新增采购物料
export function addPurRukuItemInfo(id) {
  return request({
    url: '/business/rukuInfo/addPurRukuItemInfo/' + id,
    method: 'get'
  })
}
//添加出库单
export function addChukuRukuItemInfo(id) {
  return request({
    url: '/business/rukuInfo/addChukuRukuItemInfo/' + id,
    method: 'get'
  })
}
//采购入库
export function addPurRukuInfo(data) {
  return request({
    url: '/business/rukuInfo/addPurRukuInfo',
    method: 'post',
    data: data,
    timeout:50000
  })
}
//出库单入库
export function addCkRukuInfo(data) {
  return request({
    url: '/business/rukuInfo/addCkRukuInfo',
    method: 'post',
    data: data
  })
}


// 修改入库单
export function updateRukuInfo(data) {
  return request({
    url: '/business/rukuInfo',
    method: 'put',
    data: data
  })
}

// 删除入库单
export function delRukuInfo(id) {
  return request({
    url: '/business/rukuInfo/' + id,
    method: 'delete'
  })
}
//执行入库
export function zhixingRuku(id) {
  return request({
    url: '/business/rukuInfo/zhixingRuku/' + id,
    method: 'get'
  })
}
export function listJiesuanRukuInfo(query) {
  return request({
    url: '/business/rukuInfo/jiesuanList',
    method: 'get',
    params: query
  })
}
